package com.liuyutao.service;

import com.liuyutao.dao.StudentMapper;
import com.liuyutao.pojo.Student;

import java.util.List;

public class StudentServiceImpl implements StudentService {

    private StudentMapper studentMapper;
    public void setStudentMapper(StudentMapper studentMapper){
        this.studentMapper = studentMapper;
    }
    @Override
    public List<Student> findAllStudent() {
        return studentMapper.findAllStudents();
    }

    @Override
    public Student findStudentById(Integer id) {
        return studentMapper.findStudentById(id);
    }

    @Override
    public Student findStudentByName(String name) {
        return studentMapper.findStudentByName(name);
    }

    @Override
    public Student findStudentByNameAndAddress(String name, String address) {
        return studentMapper.findStudentByNameAndAddress(name,address);
    }

    @Override
    public void deleteStudentById(Integer id) {
        studentMapper.deleteStudentById(id);
    }

    @Override
    public void addStudent(Student student) {
        studentMapper.addStudent(student);
    }

    @Override
    public void updateStudent(Student student) {
        studentMapper.updateStudent(student);
    }
}
